<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>过渡高级</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .outer {
            width: 1300px;
            height: 900px;
            border: 1px solid black;
        }

        .outer:hover .box {
            width: 1300px;
        }

        .box {
            width: 200px;
            height: 100px;
            background-color: skyblue;
            /*要过渡的属性，只能数字，百分比表示的属性才可以过渡,display就不行，的background-color是可以过滤,因为颜色是16进制 */
            /* transition-property: width, height,background-color; */
            /* 让所有能过渡的属性过渡 */
            transition-property: all;
            /*过渡时间,只写一个就是全部属性适用，可以写多个*/
            transition-duration: 5s;
            /* 过渡延迟，延迟后再开始改变 */
            /* transition-delay: 2s; */

        }

        .box1 {
            background-color: skyblue;
            /* 过渡类型，默认ease,平滑过渡，慢->快->慢 */
            transition-timing-function: ease;
        }

        .box2 {
            background-color: orange;
            /* linear线性的，匀速的,记住就行 */
            transition-timing-function: linear;
        }

        .box3 {
            background-color: green;
            /* ease-in 先慢后快 */
            transition-timing-function: ease-in;
        }

        .box4 {
            background-color: gray;
            /* ease-out 先快后慢 */
            transition-timing-function: ease-out;
        }

        .box5 {
            background-color: red;
            /* ease-in-out 慢->快->慢,ease更柔和 */
            transition-timing-function: ease-in-out;

        }

        .box6 {
            background-color: yellow;
            /* step-start 最开始直接达到终点,不考虑过渡时间,没什么用 */
            transition-timing-function: step-start;
        }

        .box7 {
            background-color: purple;
            /* step-end 不动，到了时间直接到达终点，没什么用 */
            transition-timing-function: step-end;
        }

        .box8 {
            background-color: tomato;
            /* steps steps(20)分了20份，5s内走20份 */
            transition-timing-function: steps(20);
        }

        .box9 {
            background-color: deepskyblue;
            /* 贝塞尔曲线 https://cubic-bezier.com 横轴时间，纵轴距离,可以做橡皮筋效果 */
            transition-timing-function: cubic-bezier(.79,1.04,.77,1.52);
        }
    </style>
</head>

<body>
    <div class="outer">
        <div class="box box1">慢->快->慢</div>
        <div class="box box2">匀速</div>
        <div class="box box3">先慢后快</div>
        <div class="box box4">先快后慢</div>
        <div class="box box5">慢->快->慢</div>
        <div class="box box6">直接达到终点 </div>
        <div class="box box7">到了时间直接到达终点</div>
        <div class="box box8">分步过渡，分了20份</div>
        <div class="box box9">贝塞尔曲线</div>
    </div>

</body>

</html>